Fault Detection Circuit for a PWM Driver, Related System and Integrated Circuit

ABSTRACT

Fault detection circuitry and a corresponding method are disclosed. A count value that is indicative of the switching period of a PWM signal is determined and it is determined whether this count value is between a first threshold and a second threshold. An error signal is generated when the switching period is not between the first and the second threshold. A count value that is indicative of the switch-on duration of the PWM signal is determined and compared with a switch-on threshold in order to determine whether the switch-on duration is greater than a maximum switch-on duration. A count value that is indicative of the switch-off duration of the PWM signal is determined and compared with a switch-off threshold in order to determine whether the switch-off duration is greater than a maximum switch-off duration. Error signals can be generated when the durations are greater than the maximum durations.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Italian Application No. 102016000049920, filed on May 16, 2016, which application is hereby incorporated herein by reference.

TECHNICAL FIELD

Embodiments of the present disclosure relate to solutions for detecting a fault of a Pulse Width Modulated (PWM) driver.

BACKGROUND

In automotive applications the use of Direct Current (DC) or Brushless DC (BLDC) motors for fan, pump or actuator applications is very common with the trend of replacing the traditional DC with BLDC motors. In most automotive applications, detection of fault conditions of the BLDC motor and the control electronics is mandatory. For this reason, the control electronics should be able to identify a possible fault condition and then apply counter measures, e.g., in order to protect the system. Often the detected fault condition is reported to a system controller and may be accessible via the diagnosis interface of the automobile for further service investigations.

As disclosed, e.g., in document IT102016000009376, a motor is often driven using one or more half-bridges as a function of one or more respective PWM signals.

For example, FIG. 1 shows a typical half-bridge arrangement 20 comprising two electronic switches SW₁ and SW₂, such as n-channel power MOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistor), connected in series between a supply voltage Vdd and a ground GND.

Usually, the switches SW₁ and SW₂ are closed alternatively in order to connect the output OUT of the half-bridge arrangement 20, i.e., the intermediate point between the switches SW₁ and SW₂, either to the voltage Vdd or to ground GND.

For this purpose, the half-bridge is driven as a function of two drive signals DRV₁ and DRV₂, which are connected (e.g., directly) to the control gates of the switches SW₁ and SW₂, respectively.

Specifically, in order to correctly drive the control gates, usually a high-side driver 200 ₁ is used to generate the drive signal DRV₁ for the high-side switch SW₁ as a function of a first control signal IN₁, and a low-side driver 200 ₂ is used to generate the drive signal DRV₂ for the low-side switch SW₂ as a function of a control signal IN₂.

The control signal IN₂ corresponds often to an inverted version of the signal IN₁ (or vice versa), i.e., the signal IN₂ is low when the signal IN₁ is high and vice versa. For example, in FIG. 1 is used an inverter 202 which receives at input the signal IN₁ and provides at output the signal IN₂.

The output OUT of the half-bridge arrangement 20 may be used to drive a load. For example, in FIG. 1, the half-bridge arrangement 20 drives a motor M₁ connected between the output OUT of the half-bridge arrangement 20 and ground GND.

Conversely, FIG. 2 shows an example in which two half-bridge arrangements 20 _(a) and 20 _(b) are used to drive a linear motor M₂, such as a voice coil motor, connected between the output OUT_(a) of the first bridge arrangement 20 _(a) and the output OUT_(b) of the second bridge arrangement 20 b. As well known to those of skill in the art, in this case, also the rotation direction of the motor M₂ may be controlled by applying appropriate control signals IN_(a) and IN_(b) to the half-bridge arrangements 20 _(a) and 20 _(b).

Finally, FIG. 3 shows an example in which three half-bridge arrangements 20 _(a), 20 _(b) and 20 _(c) are used to drive a three phase motor M₃, such as a spindle motor, connected between the outputs OUT_(a), OUT_(b) and OUT_(c) of the half-bridge arrangements 20 _(a), 20 _(b) and 20 _(c).

As mentioned before, the control signals may be PWM signals, i.e., signals with a fixed frequency and a variably duty cycle. For example, document IT102015000046790 discloses a solution for generating two PWM signals which may be used, e.g., for generating the signals IN_(a) and IN_(b) in the solution shown in FIG. 2.

FIG. 4 shows in this regards a typical PWM signal PWM, such as the signal IN, corresponding to a pulsed signal comprising a single pulse P for each switching cycle with duration or period T_(PWM), wherein the switch-on duration T_(ON) of the pulse P may be variable as a function of a control signal.

Generally, the pulse P is not necessarily at the beginning of each switching cycle, but each switching cycle may comprise an initial switch-off period T_(OFF1) before the pulse P and a final switch-off period T_(OFF2) after the pulse P, with:

T _(PWM) =T _(OFF1) +T _(ON) +T _(OFF2)  (1)

with the switch-off duration T_(OFF) being:

T _(OFF) =T _(OFF1) +T _(OFF2)  (2)

wherein the duty cycle D of each switching cycle is given by:

D=T _(ON) /T _(PWM)  (3)

Accordingly, e.g., for an advanced automotive application, the diagnoses of control electronics should include a detection circuit configured to detect PWM hardware failures.

FIGS. 5a and 5b shows typical PWM hardware failures. Specifically, FIG. 5a shows the desired or requested PWM signal PWM_(R) comprising four pulses P1-P4 and FIG. 5b shows the generated signal PWM. In the example considered, the third pulse P3 has a different duty cycle and the fourth pulse P4 is missing.

In order to detect such PWM failures, two known solutions can be used.

FIG. 6 shows the first solution, wherein a redundancy control is performed.

Specifically, in the example considered, a first PWM signal generator 30 ₁ is used to generate a first PWM signal PWM₁, such as the signals IN described with respect to FIGS. 1 to 3, which may be used to drive a half-bridge arrangement 20.

The circuit comprises moreover a second PWM signal generator 30 ₂ configured to generate a second PWM signal PWM₂, wherein both PWM signal generators 30 ₁ and 30 ₂ are redundant, i.e., use the same configuration and thus should generate the same PWM signals.

In the example considered, an additional redundancy control checking unit 32, often in the form of a dedicated hardware module, is used to verify whether the signals PWM₁ and PWM₂ correspond, and possibly generates a failure signal FS when a mismatch is detected.

Conversely FIG. 7 shows the second solution. In this case a single PWM signal generator 30 is used to generate a PWM signal PWM.

In the example considered, the signal PWM is provided to a read-back module 34, often in the form of a dedicated hardware module, which determines the characteristics of the PWM signal, such as the switching period T_(PWM) and the switch-on time T_(ON).

These characteristics are provided to a further module 36, such as a software module, which verifies whether the characteristics requested correspond to the generated characteristics provided by the read-back module 34, and possibly generates a failure signal FS when a mismatch is detected.

The above solutions are described, e.g., in the application note AN4266—“Safety application guide for SPC56xL70xx family”, STMicroelectronics, September 2013.

SUMMARY

The inventor has observed that the solutions described in the background section have several drawbacks.

With regards to the first solution (see FIG. 6), in order to exploit redundancy, the PWM hardware channel PWM₁ and the redundant one PWM₂ should belong to independent modules in order to decrease the probability of CCFs (Common Cause Faults) and the comparison at the module 32 should be demanded to an additional dedicated hardware. Thus, while this solution permits to detect PWM hardware failures immediately, the solution has a significant drawback in terms of device size and cost.

With regards to the second solution (see FIG. 7), a single additional dedicated hardware 34 with read-back feature is sufficient in order to have available the required read-back characteristics. As a result, implementing this solution affects less significantly the device size. However, the type of failure may often not be detected, such as in case of short circuit to ground or to power supply, or in case the PWM module 30 is not working at all. Moreover, the detection of a failure is often not immediate but depends on the type of failure and the latency of the circuit 34 and the execution time of the (software) module 36.

In view of the above, embodiments of the present disclosure provides solutions that overcome one or more of the above drawbacks.

According to one or more embodiments, a fault detection circuit for a PWM driver is provided. Embodiments moreover concern a related system and integrated circuit.

As mentioned before, the present disclosure relates to a fault detection circuit for a PWM driver configured to generate a PWM signal having a given switching period, switch-on duration and switch-off duration.

In various embodiments, the fault detection circuit comprises a first sub-circuit configured to determine a count value being indicative of the switching period of the PWM signal. For example, in various embodiments, the first sub-circuit comprises a counter and a respective counter reset circuit configured to reset the counter once for each PWM cycle of the PWM signal. For example, the counter reset circuit may receive from the PWM driver a PWM period signal comprising a pulse when a new PWM cycle starts, or the counter reset circuit may reset the counter at each rising or alternatively at each falling edge of the PWM signal.

In various embodiments, the first sub-circuit tests whether the count value being indicative of the switching period is between a first and a second threshold and generates one or more error signals when the switching period is not between these thresholds. In various embodiments, the thresholds are stored in a programmable memory.

In various embodiments, the fault detection circuit comprises a second sub-circuit. The second sub-circuit determines a count value being indicative of the switch-on duration of the PWM signal and a count value being indicative of the switch-off duration of the PWM signal. Next, the second sub-circuit compares the count value being indicative of the switch-on duration with a switch-on threshold in order to determine whether the switch-on duration is greater than a maximum switch-on duration and possibly generates a switch-on error signal when the switch-on duration is greater than the maximum switch-on duration. Similarly, the second sub-circuit compares the count value being indicative of the switch-off duration with a switch-off threshold in order to determine whether the switch-off duration is greater than a maximum switch-off duration and possibly generates a switch-off error signal when the switch-off duration is greater than the maximum switch-off duration. Again, these thresholds may be stored in a programmable memory.

For example, in various embodiments, the second sub-circuit uses the same counter in order to determine the count value being indicative of the switch-on duration and the count value being indicative of the switch-off duration, i.e., the second sub-circuit comprises one counter configured to generate one count value, wherein this count value is indicative of the switch-on duration when the PWM signal is high and indicative of the switch-off duration when the PWM signal is low. In this case, the second sub-circuit may comprise a respective counter reset circuit configured to reset this counter at each rising and each falling edge of the PWM signal.

For example, in various embodiments, the mentioned counter is an up-and-down counter configured to increase the respective count value when the PWM signal has a first logic level, e.g., is high, and decrease the count value when the PWM signal has a second logic level, e.g., is low.

In various embodiments, the second sub-circuit may thus comprise two comparators. The first comparator generates the switch-on error signal by comparing the count value with the switch-on threshold and the second comparator generates the switch-off error signal by comparing the count value with the switch-off threshold.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the present disclosure will now be described with reference to the annexed drawings, which are provided purely by way of non-limiting example and in which:

FIGS. 1, 2 and 3 shows solutions for driving a motor;

FIG. 4 show a typical PWM signal;

FIGS. 5a and 5b show typical PWM failures;

FIGS. 6 and 7 show prior-art solutions for detecting a PWM failure;

FIG. 8 shows an embodiment of a PWM driver and a respective fault detection circuit comprising two sub-circuits;

FIG. 9 shows an example of the signals generated by the PWM driver of FIG. 8;

FIGS. 10 an 11 show an embodiment of the first sub-circuit of the fault detection circuit of FIG. 8;

FIG. 12 show a first embodiment of the second sub-circuit of the fault detection circuit of FIG. 8;

FIGS. 13, 14 and 15 show possible embodiments of the second sub-circuit of FIG. 12;

FIG. 16 show a second embodiment of the second sub-circuit of the fault detection circuit of FIG. 8;

FIG. 17 show a third embodiment of the second sub-circuit of the fault detection circuit of FIG. 8; and

FIGS. 18 and 19 show a fourth embodiment of the second sub-circuit of the fault detection circuit of FIG. 8.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

In the following description, numerous specific details are given to provide a thorough understanding of embodiments. The embodiments can be practiced without one or several specific details, or with other methods, components, materials, etc. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring aspects of the embodiments.

Reference throughout this specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

The headings provided herein are for convenience only and do not interpret the scope or meaning of the embodiments.

In the following FIGS. 8 to 19 parts, elements or components which have already been described with reference to FIGS. 1 to 7 are denoted by the same references previously used in such Figures; the description of such previously described elements will not be repeated in the following in order not to overburden the present detailed description.

As mentioned in the foregoing, the present disclosure relates to a fault detection circuit for a PWM signal generator.

FIG. 8 shows the general architecture of a PWM system in accordance with the present disclosure.

In the embodiment considered, the system comprises a PWM driver 40 and a fault detection circuit 46.

In various embodiments, the PWM driver 40 comprise at least a PWM signal generator 400, such as the module 30 described in the foregoing, such as a configurable hardware module or a software programmed microprocessor, generating a PWM signal PWM having a given frequency and duty cycle (see also, the description with respect to FIG. 4).

In various embodiments, the PWM signal generator 400 is configured to generate a low power PWM signal PWM, e.g., a signal with a maximum voltage between 3.0 and 5 V and maximum current below 100 mA. In this case, the PWM signal generator circuit 40 may also comprise a driver circuit 402 configured to convert the low power PWM signal PWM provided by the circuit 400 in a higher power signal PWM_(HP), i.e., a signal having a higher maximum voltage and/or maximum current. For example, in various embodiments, the driver circuit 402 may comprise a half-bridge arrangement 20 (see e.g., FIG. 1).

In various embodiments, the PWM driver 40, in particular the PWM signal generator 400, is configured to generate the signal PWM as a function of one or more control signals 42 indicating one or more requested characteristics of the signal PWM. For example, in the embodiment considered, the one or more control signals 42 are generated by a control unit 44. For example, these control signal(s) 42 may indicate only the duty cycle or switch-on period T_(ON) and the switching period T_(PWM) may be constant. In alternative or in addition, the control signal(s) 42 may indicate the switching period T_(PWM). In various embodiments, the control signal(s) 42 may also vary for each PWM cycle.

For example, in various embodiments considered, the control unit 44 may be a software programmed microprocessor of a microcontroller and the low power signal generator 400 and possibly the driver 402 may be a dedicated hardware module of the same microcontroller. For example, in this case, the operation of the PWM signal generator circuit 40 may be controlled via so called Special Function Registers (SFR) of this microcontroller.

In the embodiment considered, the system comprises moreover a fault detection circuit 46. In various embodiments, also the fault detection circuit 46 may be a hardware module of the microcontroller comprising the control unit 44 and/or the PWM driver 40.

In the embodiment considered, the fault detection circuit 46 receives a PWM period signal PS, e.g., a series of pulses with a period equals to the period T_(PWM), generated by the PWM driver 40, e.g., by the circuit 400. As shown in FIG. 9, the PWM period signal PS may indicate the start of each PWM cycle or period and may correspond to a pulsed signal being set, e.g., to “high” for one or more clock cycles when a new PWM cycle starts.

In the embodiment considered, the fault detection circuit 46 receives moreover one of the PWM signals generated by the PWM signal generator 40, such as the low power signal PWM or the high-power signal PWM_(HP), e.g., one of the signal IN, DRV₁/DRV₂ or OUT shown in FIG. 1.

In various embodiments, the PWM period signal PS may be routed internally to the fault detection circuit 46 and the PWM output signal PWM/PWM_(HP) may be externally routed (e.g., via an external connection of the pins of the microcontroller) to the fault detection circuit 46. Such an external routing may be requested by safety requirements to cover also package faults.

In various embodiments, the fault detection circuit 46 moreover receives one or more control signals 48 indicating one or more fault detection characteristics. In the embodiment considered, the control signal(s) 48 are generated by a block 50 configured to determine the control signal(s) 48 indicating the fault detection characteristics as a function of the control signal(s) 42 indicating one or more requested characteristics of the PWM signal. For example, the block 50 may be a dedicated hardware module, such as a dedicated hardware model of the microcontroller comprising the control unit 44, or a software module of the control unit 44.

In various embodiments, the fault detection circuit 46 comprises two submodules 460 and 480. The first submodule 460 is configured to analyses the switching period T_(PWM) of the signal PWM. Conversely, the second submodule 480 is configured to analyses the switch-on and switch-off periods of the signal PWM.

FIG. 10 shows a first embodiment of the submodule 460.

In the embodiment considered, the PWM driver 40, in particular the low power signal generator 400, is driven using a first clock signal CLK₁. Conversely, the submodule 460 is driven using a second clock signal CLK₂. Generally, the clock signals CLK₁ and CLK₂ may also be the same clock signal, e.g., the clock signal of the control unit 44.

As mentioned in the foregoing, the submodule 460 is configured to analyses the switching period T_(PWM) of the signal PWM. For this reason, the submodule 460 is configured to determine by means of the signal PS whether the duration of the PWM period is within given limits.

Specifically, in the embodiment considered, the submodule 460 comprises a digital counter 4600 and a counter reset circuit 4602. More specifically, in the embodiment considered, the counter reset circuit 4602 is configure to generate a reset signal RST adapted to reset the counter 4600 when the signal PS indicates that a new PWM cycle has started. Generally, this circuit 4602 is purely optional, because the signal PS could already correspond to a signal being adapted to reset the counter 4600, such as a signal being set to high only for short period, such as one clock cycle, at the beginning of each PWM cycle. Accordingly, the counter 4600 is configured to vary (i.e., increase or decrease depending on the type of counter used) a count value CNT₁ at each clock event of the clock signal CLK₂ and reset the count value CNT₁ when the signal PS indicates the start of a new PWM cycle.

In the embodiment considered, the submodule 460 comprises also two comparators 4604 and 4606 configured to compare the count value CNT₁ of the counter 4600 with a first threshold TH₁ and a second threshold TH₂, respectively. For example, these thresholds TH₁ and TH₂ may be stored in respective registers 4608 and 4610, and the content of these registers may be programmed via the block 50 via respective signals 48 ₁ and 48 ₂.

FIG. 11 shows an embodiment of the operation of the submodule 460, wherein a synchronous up-counter 4600 is used. Accordingly, in the embodiment considered, the counter 4600 is configure to reset the count value CNT₁ as a function the signal PS at the beginning of each PWM cycle and then increase the count value CNT₁ in accordance with the clock signal CLK₂. Moreover, when the count value CNT₁ is greater than the threshold TH₁, the comparator 4604 will change the respective output signal CMP₁, e.g., set the output CMP₁ of the comparator 4604 to high. Similarly, when the count value CNT₁ is greater than the threshold TH₂, the comparator 4606 will change the respective output signal.

As shown in FIG. 11, in case the PWM period is correct, the output of the comparator 4604 should be high and the output of the comparator 4606 should be low when a new PWM cycle starts, i.e., the count value CNT₁ should be greater than the first threshold TH₁, but smaller than the second threshold TH₂. Accordingly, the block 50 should set the content of the registers 4608 and 4610 in order to satisfy these conditions. For example, in various embodiment the block 50 may be configured to set the registers 4608 and 4610 according to the following relations:

T _(H) =C _(PWM) _(_) _(CLOCK) −X ₁  (4)

TH ₂ =C _(PWM) _(_) _(CLOCK) +X ₂  (5)

where C_(PWM) _(_) _(CLOCK) corresponds to the PWM period T_(PWM) in number of clock cycles of the clock signal CLK₂, and X₁ and X₁ are one or more clock cycle of the same clock representing the tolerance accepted for the PWM period T_(PWM).

Accordingly, when the PWM period is correct, the count value CNT₁ should be between the first threshold TH₁ and the second threshold TH₂ at the end of each PWM cycle, i.e., when the counter 4600 is reset.

Conversely, when the count value CNT₁ reaches the second threshold TH₂ during a PWM cycle, i.e., before the counter 4600 is reset, the PWM cycle is too long and an error should be created. For example, in the embodiment considered, this may be achieved by using the output of the comparator 4606 as an error signal ERR₂ indicating that the PWM period is too long.

Conversely, the PWM period is too short, when the count value CNT₁ does not reach the first threshold TH₁ during a PWM cycle, i.e., before the counter 4600 is reset. For example, in the embodiment considered this is achieved by means of a verification circuit 4612, which receives at input the reset signal RST from the counter reset circuit 4602 (or possibly the signal PS) and the comparison signal from the comparator 4604. In particular, this verification circuit 4612 is configured to generate an error signal ERR₁, indicating that the count value CNT₁ was smaller than the first threshold TH₁ when a new PWM period started, i.e., when a new reset of the counter 4600 occurred.

In various embodiments, once having detected an error, the sub-circuit 460 may store the value of the error signals ERR₁ and/or ERR₂ in a memory, such as register or flip-flop. For example, in various embodiments, each error signal is connected to the set input of a set-reset flip-flop or latch.

FIG. 12 shows a first embodiment of the submodule 480.

As mentioned before, the second submodule 480 is configured to analyses the switch-on and switch-off durations of the PWM signal.

In the embodiment considered, the submodule 480 comprises two circuits 482 _(ON) and 482 _(OFF) configured to determine respectively whether the switch-on and switch-off durations of the PWM period are within given limits.

In the embodiments considered, the circuit 482 _(ON) and 482 _(OFF) have substantially the architecture of the circuit 460 shown in FIG. 10.

FIG. 13 shown in this regards a generic circuit 482 which may be used for both circuits 482 _(ON) and 482 _(OFF). Specifically, also in this case, the circuit 482 comprises a counter 4820 (possibly having associated therewith a counter reset circuit 4822), two comparators 4824 and 4826 (possibly having associated therewith a respective threshold registers 4828 and 4830), and a verification circuit 4832. Specifically, the circuit operate similar to the submodule 460, with the only difference that the counter 4820 is enabled either when the PWM signal is high (for the circuit 482 _(ON)) or when the PWM signal is low (for the circuit 482 _(OFF)).

Accordingly, similar to the circuit 460, the counter 4820 will be reset at each new PWM period and the counter 4820 will vary (increase or decrease) the count value CNT₂ of the counter 4820 at each clock cycle. However, in this case, the counter 4820 is only enabled when the PWM signal is high (for the circuit 482 _(ON)) or low (for the circuit 482 _(OFF)), i.e., the count value CNT₂ is indicative of the switch-on/switch-off duration of the signal PWM. Accordingly, similar to the circuit 460, this count value may be compared at the comparators 4824 and 4826 with two threshold values TH₃ and TH₄.

For example, in case of the circuit 482 _(ON), the comparator 4826 will generate an error signal ERR₄ when the count value CNT₂ is greater than the threshold TH₄, thereby indicating that the switch-on duration was too long. Conversely, the verification circuit 4832 is configured to generate an error signal ERR₃ when the count value CNT₂ was smaller than the first threshold TH₃ and a new PWM period started, thereby indicating that the switch-on duration was too short.

Similarly, in case of the circuit 482 _(OFF), the comparator 4826 will generate an error signal ERR₆ when the count value CNT₂ is greater than the threshold TH₄, thereby indicating that the switch-off duration was too long. Conversely, the verification circuit 4832 is configured to generate an error signal ERR₅ when the count value CNT₂ was smaller than the first threshold TH₃ and a new PWM period started, thereby indicating that the switch-off duration was too short.

Generally, instead of using the PWM period signal PS, the counter reset circuit 4822 may also operate with the signal PWM in order to detect a new PWM period. For example, in this case, the counter reset circuit 4822 may detect the rising edges (or alternatively the falling edges) in the signal PWM in order to reset the counter 4820. This embodiment permits thus to detect spikes in the signal PWM, because such spikes will reset the counter 4820. The same applies also to the counter reset circuit 4602 of the circuit 460. Accordingly, in general, the signal PS is purely optional.

FIG. 14 shows a second embodiment of the circuit 482, in which the reset signal RST provided by the circuit 4822 corresponds directly to the PWM signal (for the circuit 482 _(OFF)) or to the inverted PWM signal (for the circuit 482 _(ON)). In this case, the counter 4820 does also not require an enable port.

In fact, as shown in FIG. 15 at the example of the circuit 482 _(ON), the reset signal will maintain the counter 4820 reset when the PWM signal is low and the counter 4820 will start to count when the signal PWM is high. Accordingly, the verification circuit 4832 may determine whether the comparison signal CMP₂ at the output of the comparator 4824 is set at the next rising edge of the reset signal RST.

The above embodiments do, however, not take into account that indeed a relationship exists between the switch-on duration and the switch-off duration. In fact, assuming that the duration T_(PWM) of the PWM cycle is correct (which is already verified by the circuit 460), a too long switch-on duration T_(ON) (signal ERR₄ is set) will automatically imply a too short switch-off duration T_(OFF) (signal ERR₅ is set) and similarly a too short switch-on duration T_(ON) (signal ERR₃ is set) will automatically imply a too long switch-off duration T_(OFF) (signal ERR₆ is set).

Accordingly, it is also sufficient to use only one of the circuits 482 _(ON) or 482 _(OFF) or, when using both circuits, the blocks 4824, 4828 and 4832 are redundant.

In this regards FIG. 16 shows an embodiment of the complete submodule 480 with reduced complexity, in which the blocks 4824, 4828 and 4832 have been removed.

Accordingly, in the embodiment considered, the submodule 480 comprises two counter 4820 _(ON) and 4820 _(OFF). The first counter 4820 _(ON) is enabled when the signal PWM is high and reset when the signal PWM is low. As mentioned in the foregoing, this may be achieved by means of an inverter in the counter reset circuit 4822, i.e., the reset signal RST_(ON) for the counter 4820 _(ON) may correspond to the inverted signal PWM. Conversely, the second counter 4820 _(OFF) is enabled when the signal PWM is low and reset when the signal PWM is high. As mentioned in the foregoing, this may be achieved by using the signal PWM directly as reset signal RST_(OFF) for the counter 4820 _(OFF).

Accordingly, in the embodiment considered, the count value CNT_(2,ON) of the counter 4820 _(ON) will be indicative of the switch-on duration T_(ON) and the count value CNT_(2,OFF) of the counter 4820 _(OFF) will be indicative of the switch-off duration T_(OFF).

In the embodiment considered, the count value CNT_(2,ON) is compared at a comparator 4826 _(ON) with a threshold TH_(ON) in order to determine whether the switch-on duration T_(ON) is too long and the output of the comparator 4826 _(ON) is used as error signal ERR_(ON). As mentioned in the forgoing, the threshold TH_(ON) may be stored in a register 4830 _(ON), which may be programmable via the module 50 by means of a control signal 48 _(ON).

Similarly, the count value CNT_(2,OFF) may be compared at a comparator 4826 _(OFF) with a threshold TH_(OFF) in order to determine whether the switch-off duration T_(OFF) is too long and the output of the comparator 4826 _(OFF) may be used as error signal ERR_(OFF). Also in this case, the threshold TH_(OFF) may be stored in a register 4830 _(OFF), which may be programmable via the module 50 by means of a control signal 48 _(OFF).

This embodiment does, however, not take into account that indeed only one of the counters 4820 _(ON) or 4820 _(OFF) will be enabled at a given time.

Accordingly, indeed a single counter may be used for the submodule 480.

FIG. 17 shows a first embodiment of the submodule 480 with a single counter 4800.

Specifically, in the embodiment considered, the counter 4800 is configured to reset a count value CNT₃ in response to a reset signal RST. Specifically, this reset signal RST is generated by a counter reset circuit 4802 at each rising edge and at each falling edge of the signal PWM. Accordingly, the counter 4802 varies (increases or decreases based on the counter used) the count value CNT₃ until a new rising or falling edge occurs in the signal PWM.

In the embodiment considered, the count value CNT₃ is provided to a comparator 4806. Specifically, this comparator 4806 is configured to compare, as a function of the value of the signal PWM, the count value CNT₃ either with a switch-on threshold TH_(ON) (signal PWM is high) or a switch-off threshold TH_(OFF) (signal PWM is low). For example, in the embodiment considered, the selection is performed by means of a multiplexer 4814. Again, these thresholds may be stored in respective registers 4810 _(ON) and 4810 _(OFF), which may be programmable via the module 50 by means of control signals 48 _(ON) and 48 _(OFF).

Accordingly, when the signal PWM is high, the count value CNT₃ is indicative for the switch-on duration T_(ON) and the comparator 4806 indicates whether the switch-on duration T_(ON) is too long, e.g., greater than the threshold TH_(ON). Conversely, when the signal PWM is low, the count value CNT₃ is indicative for the switch-off duration T_(OFF) and the comparator 4806 indicates whether the switch-off duration T_(OFF) is too long, e.g., greater than the threshold TH_(OFF). Accordingly, a simple de-multiplexer 4816 receiving at input the comparison signal provided by the comparator 4806 and driven by means of the signal PWM may be used in order to generate respective error signal ERR_(ON) and ERR_(OFF) indicating whether the switch-on duration T_(ON) or switch-off duration T_(OFF) are too long, respectively.

FIG. 18 shows an alternative embodiment of the submodule 480 wherein an up-and-down counter 4800 is used, thereby avoiding the need for multiplexers and de-multiplexers.

Specifically, in the embodiment considered, the counter 4800 is configured to reset a count value CNT₃ in response to a reset signal RST. Specifically, this reset signal RST is generated by a counter reset circuit 4802 at each rising and each falling edge of the signal PWM. Accordingly, the counter 4800 varies (increases or decreases based on a selection signal) the count value CNT₃ until a new rising of failing edge in the signal PWM occurs. Specifically, the counter 4800 is configure to increase or decreases the count value CNT₃ as a function of the value of the signal PWM. For example, in the embodiment considered, the count value CNT₃ is increased when the signal PWM is high and the count value CNT₃ is decreased when the signal PWM is low.

In the embodiment considered, the count value CNT₃ is provided to two comparators 4806 _(ON) and 4806 _(OFF).

Specifically, the comparator 4806 _(ON) is configured to compare the count value CNT₃ with a switch-on threshold TH_(ON), and the comparator 4806 _(OFF) is configured to compare the count value CNT₃ with a switch-off threshold TH_(OFF).

Accordingly, as shown in FIG. 18, when the signal PWM is high, the count value CNT₃ may have a positive value being indicative of the switch-on duration T_(ON) and the comparator 4806 _(ON) indicates whether the switch-on duration T_(ON) is too long, i.e., greater than the threshold TH_(ON) being set to a positive value. Conversely, when the signal PWM is low, the count value CNT₃ may have a negative value being indicative of the switch-off duration T_(OFF) and the comparator 4806 _(OFF) indicates whether the switch-off duration T_(OFF) is too long, i.e., smaller than the threshold TH_(OFF) being set usually to a negative value. Accordingly, in the embodiment considered, the outputs of the comparators 4806 _(ON) and 4806 _(OFF) may be used as error signal ERR_(ON) and ERR_(OFF) indicating whether the switch-on duration T_(ON) or switch-off duration T_(OFF) are too long, respectively.

Accordingly, in the embodiment considered, the counter reset circuit 4802 detects the logic level of the signal PWM and, on each logic level change, it resets the counter 4800. Moreover, the signal PWM indicates whether the counter 4800 has to operate as an up-counter or a down-counter, e.g., the counter 4800 may count up if the logic level of the signal PWM is high and count down if the logic level of the signal PWM is low.

As result, in case of correct operation, the counter 4800 counts as shown in the FIG. 19. If the duration of the switch-on time T_(ON) of the PWM signal is longer than the expected one, the comparator 4806 _(ON) output changes and a failure is signaled via the signal ERR_(ON). Conversely, if the duration of the switch-off time T_(OFF) of the PWM signal is longer than the expected one, the comparator 4806 _(OFF) output changes and a failure is signaled via the signal ERR_(OFF).

The setting of the thresholds TH_(ON) and TH_(OFF) is performed in time by the module 50 by means of control signal 48 _(ON) and 48 _(OFF), e.g., when the PWM configuration parameters 42 change and/or at the being of a new PWM period. As mentioned in the foregoing, preferably these thresholds are determined as a function of the PWM configuration parameters 42.

Generally, the proper selection of the thresholds TH_(ON) and TH_(OFF) is application dependent. For example, in case the counter 4800 behaves as an up-counter when the signal PWM is high, the module 50 may use the following relations:

TH _(ON) =C _(RES,UP)+(C _(PWM) _(_) _(ON,N) +X ₃)  (6)

TH _(OFF) =C _(RES,DOWN)−(C _(PWM) _(_) _(OFF1,N) +C _(PWM) _(_) _(OFF1,N−1) +X ₄)  (7)

where C_(RES,UP) and C_(RES,DOWN) are the reset values of the counter 4800 when operating as up-counter or down-counter, respectively, C_(PWM) _(_) _(ON,N), C_(PWM) _(_) _(OFF1,N) and C_(PWM) _(_) _(OFF2,N−1) are respectively the switch-on time T_(ON) of the PWM period N, the initial off-time T_(OFF), of the PWM period N and the final off-time T_(OFF2) of the PWM period N−1 in number of clock cycle of the clock signal CLK₂, and X₃ and X₄ are one or more clock cycle of the same clock representing the accepted tolerance.

Similarly, in case the counter 4800 behaves as a down-counter when the signal PWM is high, the module 50 may use the following relations:

TH _(ON) =C _(RES,DOWN)−(C _(PWM) _(_) _(ON,N) +X ₃)  (8)

TH _(OFF) =C _(RES,UP)+(C _(PWM) _(_) _(OFF1,N) +C _(PWM) _(_) _(OFF1,N−1) +X ₄)  (9)

In this case, however, also the inputs of the comparators 4604 and 4606 have to be switched, i.e., the comparator 4604 indicates an error when the count value CNT₃ is smaller than the threshold TH_(ON) and the comparator 4606 indicates an error when the count value CNT₃ is greater than the threshold TH_(OFF).

In various embodiments, once having detected an error, the sub-circuit 480 may store the values of the error signals ERR_(ON) and/or ERR_(OFF) in a memory, such as register or flip-flop. For example, in various embodiments, each error signal is connected to the set input of a set-reset flip-flop or latch.

Thus, generally, the sub-circuit 480 determines a count value being indicative of the switch-on duration T_(ON) and a count value being indicative of the switch-off duration T_(OFF). For example, the same counter 4800 is used for this purpose in the embodiments shown in FIGS. 17 and 18,

Next, the sub-circuit 480 compares the count value being indicative of the switch-on duration T_(ON) with a switch-on threshold TH_(ON) in order to determine whether the switch-on duration T_(ON) is greater than a maximum switch-on duration. As mentioned in the foregoing, based on the operation of the counter, the comparison may indeed determine at the circuit level whether the count value is smaller than a maximum threshold value. However, this comparison still determines whether the switch-on duration T_(ON) is greater than a maximum switch-on duration, and possibly generates an error signal ERR_(ON) when the switch-on duration T_(ON) is greater than the maximum switch-on duration.

Similarly, the sub-circuit 460 compares the value being indicative of the switch-off duration with a switch-off threshold TH_(OFF) in order to determine whether the switch-off duration T_(OFF) is greater than a maximum switch-off duration, and possibly generates an error signal ERR_(OFF) when the switch-off duration T_(OFF) is greater than the maximum switch-off duration.

The solutions disclosed herein have thus significant advantages with respect to the known solutions. In fact, similar to the read-back method shown in FIG. 7, the fault detection circuit 460 operates with the real PWM signal, permitting thus a monitoring also of high-power PWM signals. However, the solution directly detects possible PWM failures at most at the end of the PWM cycle, without affecting significantly the overall device size.

Of course, without prejudice to the principle of the invention, the details of construction and the embodiments may vary widely with respect to what has been described and illustrated herein purely by way of example, without thereby departing from the scope of the present invention, as defined by the ensuing claims. 

What is claimed is:
 1. A method of detecting a fault in a PWM signal having a switching period, switch-on duration and switch-off duration, the method comprising: determining a count value that is indicative of a switching period of the PWM signal; testing whether the count value that is indicative of the switching period is between a first threshold and a second threshold; generating an error signal when the switching period is not between the first and the second threshold; determining a count value that is indicative of the switch-on duration of the PWM signal; comparing the count value that is indicative of the switch-on duration with a switch-on threshold in order to determine whether the switch-on duration is greater than a maximum switch-on duration; generating a switch-on error signal when the switch-on duration is greater than the maximum switch-on duration; determining a count value that is indicative of the switch-off duration of the PWM signal; comparing the count value that is indicative of the switch-off duration with a switch-off threshold in order to determine whether the switch-off duration is greater than a maximum switch-off duration; and generating a switch-off error signal when the switch-off duration is greater than the maximum switch-off duration.
 2. The method according to claim 1, wherein determining the count value comprises using a counter to generate a count value, wherein the count value is indicative of the switch-on duration when the PWM signal is high, and wherein the count value is indicative of the switch-off duration when the PWM signal is low.
 3. The method according to claim 2, further comprising resetting the counter at each rising edge and each falling edge of the PWM signal.
 4. The method according to claim 2, wherein where in the count value is incremented when the PWM signal has a first logic level and decremented when the PWM signal has a second logic level.
 5. The method according to claim 4, wherein generating the switch-on error signal comprises comparing the count value with the switch-on threshold, and wherein generating the switch-off error signal comprises comparing the count value with the switch-off threshold.
 6. The method according to claim 1, further comprising storing the first threshold, the second threshold, the switch-on threshold, the switch-off threshold in programmable memory.
 7. The method according to claim 1, further comprising resetting the count value that is indicative of the switching period once for each PWM cycle of the PWM signal.
 8. The method according to claim 7, further comprising receiving a PWM period signal comprising a pulse when a new PWM cycle of the PWM signal starts.
 9. The method according to claim 7, wherein the count value that is indicative of the switching period is reset at each rising or each falling edge of the PWM signal.
 10. A fault detection circuit for a PWM driver configured to generate a PWM signal having a given switching period, switch-on duration and switch-off duration, the fault detection circuit comprising: a first sub-circuit being configured to: determine a count value that is indicative of a switching period of the PWM signal, test whether the count value that is indicative of the switching period is between a first threshold and a second threshold, and generate an error signal when the switching period is not between the first and the second threshold; and a second sub-circuit being configured to: determine a count value that is indicative of the switch-on duration of the PWM signal, compare the count value that is indicative of the switch-on duration with a switch-on threshold in order to determine whether the switch-on duration is greater than a maximum switch-on duration, generate a switch-on error signal when the switch-on duration is greater than the maximum switch-on duration, determine a count value that is indicative of the switch-off duration of the PWM signal, compare the count value that is indicative of the switch-off duration with a switch-off threshold in order to determine whether the switch-off duration is greater than a maximum switch-off duration, and generate a switch-off error signal when the switch-off duration is greater than the maximum switch-off duration.
 11. The fault detection circuit according to claim 10, wherein the second sub-circuit comprises one counter configured to generate one count value, wherein the one count value is indicative of the switch-on duration when the PWM signal is high, and wherein the one count value is indicative of the switch-off duration when the PWM signal is low.
 12. The fault detection circuit according to claim 11, wherein the second sub-circuit comprises a counter reset circuit configured to reset the one counter at each rising edge and each falling edge of the PWM signal.
 13. The fault detection circuit according to claim 11, wherein the one counter is an up-and-down counter configured to increase the one count value when the PWM signal has a first logic level and decrease the one count value when the PWM signal has a second logic level.
 14. The fault detection circuit according to claim 13, wherein the second sub-circuit comprises: a first comparator configured to generate the switch-on error signal by comparing the one count value with the switch-on threshold; and a second comparator configured to generate the switch-off error signal by comparing the one count value with the switch-off threshold.
 15. The fault detection circuit according to claim 10, wherein the first threshold and the second threshold or the switch-on threshold and the switch-off threshold are stored in a programmable memory.
 16. The fault detection circuit according to claim 10, wherein the first sub-circuit comprises a counter configured to generate the count value that is indicative of the switching period and a further counter reset circuit configured to reset the counter once for each PWM cycle of the PWM signal.
 17. The fault detection circuit according to claim 16, wherein the further counter reset circuit is configured to receive, from the PWM driver, a PWM period signal comprising a pulse when a new PWM cycle of the PWM signal starts.
 18. The fault detection circuit according to claim 16, wherein the further counter reset circuit is configured to reset the counter at each rising or each falling edge of the PWM signal.
 19. A system comprising: a PWM driver configured to generate a PWM signal having a given switching period, switch-on duration and switch-off duration; and a fault detection circuit configured to determine a count value that is indicative of a switching period of the PWM signal, test whether the count value that is indicative of the switching period is between a first threshold and a second threshold, and generate an error signal when the switching period is not between the first and the second threshold; and determine a count value that is indicative of the switch-on duration of the PWM signal, compare the count value that is indicative of the switch-on duration with a switch-on threshold in order to determine whether the switch-on duration is greater than a maximum switch-on duration, generate a switch-on error signal when the switch-on duration is greater than the maximum switch-on duration, determine a count value that is indicative of the switch-off duration of the PWM signal, compare the count value that is indicative of the switch-off duration with a switch-off threshold in order to determine whether the switch-off duration is greater than a maximum switch-off duration, and generate a switch-off error signal when the switch-off duration is greater than the maximum switch-off duration.
 20. The system according to claim 19, wherein the PWM driver is configured to generate the PWM signal as a function of a control signal, and wherein the system comprises a threshold circuit configured to determine the first threshold, the second threshold, the switch-on threshold, or the switch-off threshold as a function of the control signal.
 21. The system according to claim 20, wherein the system further comprises a control unit configured to generate the control signal.
 22. The system according to claim 21, wherein the control unit comprises a software programmed microprocessor. 